package com.wemew.common.enums.error;

/**
 * 作者 CG
 * 时间 2021/1/13 21:34
 * 注释 统一返回错误代码
 */
public enum Error {
    /****************************         1-1000正常    ************************************/
    Code200(200, "OK"),
    /****************************         2000-3000 系统异常     ************************************/
    Error2001(2001, "未捕获异常!"),
    Error2002(2002, "执行了全局异常处理..!"),
    Error2003(2003, "执行了ArithmeticException异常处理..!"),
    /****************************         4000-5000 登录     ************************************/
    Error4001(4001, "未获取到登录账号密码!"),
    Error4002(4002, "登录账号密码格式错误!"),
    Error4003(4003, "用户名不能为空!"),
    Error4004(4004, "密码不能为空!"),
    Error4005(4005, "用户名/密码错误!"),
    Error4006(4006, "未查询到账号信息!"),
    Error4007(4007, "未分配权限!"),
    Error4008(4008, "登录已过期!"),
    Error4009(4009, "账号已在其他设备登录!"),
    Error4010(4010, "未授权!"),
    Error4011(4011, "不允许访问!"),
    ;

    private int code;
    private String msg;

    Error(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
